
<@h.easyui />
<script type="text/javascript" src="${ctx}/js/plugins/jquery.checkbox.js"></script>
<script type="text/javascript" src="${ctx}/js/demo/user/user.js"></script>
</head>

<script type="text/javascript">
<!--
jQuery(document).ready(function(){
     //初始化 排序图标
    initSortTable("listDataTable","searchForm");
	//添加颜色改变
	mouseTrColor("listDataTable");
	
	//回选是否有效 下拉框
	jQuery("#state option[value='${(user.state)!''}']").attr("selected",true);
	
	var gradeId="";
	<#if user??>
		gradeId="${(user.gradeId)!''}";
	</#if>
	addOption("gradeId","${ctx}/grade/ajax/find_grade_json",'name','id',gradeId);
});
//-->
//selec加载 start
function addOption(selectId,_url,textName,valName,defaultValue){
 jQuery.ajax({
  url:_url,
  type:"POST",
  dataType:"json",
  success: function(json){
      jQuery("#"+selectId).empty();
      jQuery("#"+selectId).append("<option value=''>===请选择===</option>");
      jQuery(json).each(function(i,_obj){
        jQuery("#"+selectId).append("<option value='"+_obj[valName]+"'>"+_obj[textName]+"</option>");
      });
      if(defaultValue!=null&&defaultValue.length!=0){
       jQuery("#"+selectId).val(defaultValue);
      }
     }
 });
}
</script>

<body>
<!-- 操作菜单 -->
	<div class="head">
		<div class="path">用户管理 &gt; 用户列表</div>
	</div>
	<div class="contents">
<!-- 查询 -->
<form name="searchForm" id="searchForm" method="post" action="${ctx}/user/list" >
<input type="hidden" name="pageIndex" id="pageIndex" value="${(page.pageIndex)!'1'}" />
<input type="hidden" name="commTabId" id="commTabId" value="${commTabId!''}"  />
<input type="hidden" name="sort" id="page_sort" value="${(page.sort)!'desc'}"  />
<input type="hidden" name="order" id="page_order" value="${(page.order)!'id'}"  />
		<table class="tb_2">
			<tr>
	         <td>姓名:<input type="text" id="name" name="name"  value="${(user.name)!''}"  class="inp_2" /></td>
	         <td>工号:<input type="text" id="workno" name="workno"  value="${(user.workno)!''}"   class="inp_2" /></td>
	         <td>账号:<input type="text" id="account" name="account"  value="${(user.account)!''}"   class="inp_2" /></td>
	         <td>级别:<select  id="gradeId" name="gradeId"   class="inp_2" ></select></td>
	         <td>是否有效
	         	<select id="state" name="state" class="inp_2">
	         		<option value="">==请选择==</option>
	         		<option value="是">是</option>
	         		<option value="否">否</option>
	         		<option value="离职">离职</option>
	         	</select>
				<td>
					<input type="button" onclick="submitForm('searchForm');"  value="搜 索" class="btn_search"  />  
				</td>
			</tr>
		</table>
		</form>
		
<!-- 数据列表 -->
		<dl class="box_1">
			<dt>
				<div>数据</div>
					<@shiro.hasPermission name="/user/list/export" >
				<a class="a_1" href="javascript:export_excel('searchForm');">导出</a><div class="img_2" ></div>
				</@shiro.hasPermission>
				<@shiro.hasPermission name="/user/update" >
				<a class="a_3" href="javascript:f_newTab('add_user','add_user','add_user','${ctx}/user/update/pre');">添加</a><div class="img_2" ></div>
				</@shiro.hasPermission>
				<@shiro.hasPermission name="/user/delMulti" >
				<a class="a_0" href="javascript:delMulti();">删除选中</a><div class="img_2"></div>
				</@shiro.hasPermission>
			</dt>
			<dd>
			
			
			<!--start_export-->
				<table  id="listDataTable" border="1" class="tb_2">
			<!--end_no_export-->
			<!--first_start_export-->
					<tr id="table_first_tr"  bgcolor="#F1F1F1" >
					<!--first_start_no_export-->
						<th><input type="checkbox" name="check_all" id="check_all"/></th>
						<th width="100px;">操作</th>
					<!--first_end_no_export-->
						<th id="th_name" >姓名</th>
						<th id="th_workno" >工号</th>
						<th id="th_account" >账号</th>
						<th id="th_age" >年龄</th>
						<th id="th_sex" >性别</th>
						<th id="th_phone" >电话号码</th>
						<th id="th_mobile" >手机号码</th>
						<th id="th_eamil" >邮箱</th>
						<th id="th_address" >地址</th>
						<th id="th_gradeId" >级别</th>
						<th id="th_state" >是否有效</th>
						
					</tr>
				<!--first_end_export-->
				
				<!--start_export-->
				   <#if datas??&&((datas?size)>0)>
					<#list datas as data>
						<tr>
				<!--start_no_export-->
						<#if (datas?size > 0)>
							<td align="center">
								<input type="checkbox" name="check_li" value="${data.id}" />
							</td>
						</#if>
						
						<td style="text-align:center;">
								<a href="javascript:f_newTab('${data.id}_update','${data.id}_update','${data.id}_修改用户','${ctx}/user/update/pre?id=${data.id}');">修改</a>
								  /  <a href="javascript:delUser('${data.id}');">删除</a>/<a href="javascript:f_newTab('${data.id}_look','${data.id}_look','${data.id}_look','${ctx}/user/look?id=${data.id}');">查看</a>
						</td>
				<!--end_no_export-->
						
							<td >
								${(data.name)!''}
							</td>
							<td >
								${(data.workno)!''}
							</td>
							<td >
								${(data.account)!''}
							</td>
							<td >
								${(data.age)!0}
							</td>
							<td >
								${(data.sex)!''}
							</td>
							<td >
								${(data.phone)!''}
							</td>
							<td >
								${(data.mobile)!''}
							</td>
							<td >
								${(data.eamil)!''}
							</td>
							<td >
								${(data.address)!''}
							</td>
							<td >
								${(data.gradeName)!''}
							</td>
							<td >
								${(data.state)!''}
							</td>
							
						</tr>
					</#list>
					 </#if>
				</table>
			 <!--end_export-->
			</dd>
<#if page??>		
<!-- 分页 -->
	  <@h.pagetoolbar page=page formName='searchForm'/>
</#if>
		</dl>
	</div>
</body>
</html>
